/*
 * Copyright (C) 2011-2012 Andrew Wells
 *
 * Licensed under the GNU License, Version 3
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.gnu.org/copyleft/gpl.html
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * Dungeons & Dragons Copyright (C) Wizards of the Coast. I do not claim
 * the right to any information used from their books or resources.
 */

package com.trace.wells.charactertracker;

import java.io.Serializable;
//For adding item/wand/staff/magic-item information, use Speech-to-Text
//Example: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/VoiceRecognition.html
//

class Item extends Equipment implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	//wands, staffs, scrolls, etc...
	private String itemType;
	private int itemTypeInt;

	//This should describe any item that has special instructions requirements. Speech-to-Text will be usable as input here
	private String description; //Should be ArrayList<String>???
	private boolean isPermanent;
	public boolean isEquipped;
	public boolean isWieldable;
	private int usesRemaining;
	private int maxUses;

	public Item(String equipmentType, String itemType, String name, String description, boolean isPermanent, int usesRemaining, String value, String weight, boolean isEquipped, boolean isWieldable) {
		super(equipmentType, value, name, weight);
		this.itemType = itemType;
		this.itemTypeInt = ConstantHelper.convertItemTypeStringToInteger(itemType);
		this.description = description;
		this.isWieldable = isWieldable;
		this.isPermanent = isPermanent;
		this.isEquipped = isEquipped;
		if (isPermanent) {
			this.usesRemaining = usesRemaining;
			this.setMaxUses(usesRemaining);
		}
	}

	public void decrementUsesRemaining() {
		usesRemaining--;
	}

	public void resetUsesRemaining() {
		usesRemaining = maxUses;
	}

	public String getItemType() {
		return itemType;
	}

	public void setItemType(String itemType) {
		this.itemType = itemType;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public boolean isPermanent() {
		return isPermanent;
	}

	public void setPermanent(boolean isPermanent) {
		this.isPermanent = isPermanent;
	}

	public int getUsesRemaining() {
		return usesRemaining;
	}

	public void setUsesRemaining(int usesRemaining) {
		this.usesRemaining = usesRemaining;
	}

	public void setMaxUses(int maxUses) {
		this.maxUses = maxUses;
	}

	public int getMaxUses() {
		return maxUses;
	}

	/**
	 * @return the isEquipped
	 */
	public boolean isEquipped() {
		return isEquipped;
	}

	/**
	 * @param isEquipped
	 *            the isEquipped to set
	 */
	public void setEquipped(boolean isEquipped) {
		this.isEquipped = isEquipped;
	}

	/**
	 * @return the isWieldable
	 */
	public boolean isWieldable() {
		return isWieldable;
	}

	/**
	 * @param isWieldable
	 *            the isWieldable to set
	 */
	public void setWieldable(boolean isWieldable) {
		this.isWieldable = isWieldable;
	}

	public void setItemTypeInt(int itemTypeInt) {
		this.itemTypeInt = itemTypeInt;
	}

	public int getItemTypeInt() {
		return itemTypeInt;
	}

}
